package com.wuster.result;

import lombok.Getter;

/**
 * ClassName: ResultCodeEnum
 * Package: com.wuster.result
 * Description:统一返回结果状态信息类
 * @Author VictoriaZhou
 * @Create 2024/7/9 9:43
 * @Version 1.0
 */
@Getter
public enum ResultCodeEnum {
    SUCCESS(200, "成功"),
    FAIL(201, "失败"),

    //无token,请登录
    NO_TOKEN(401,"请登录"),

    //管理员的状态码
    OLDPASSWORD_ERRPR(501,"旧密码错误"),
    OLDPASSWORD_IS_NOT_NULL(502,"旧密码不能为空"),
    NEWPASSWORD_LENGTH_SHORT(503,"新密码长度过短"),
    NEWPASSWORD_LENGTH_LONG(504,"新密码长度过长"),
    NEWPASSWORD_LENGTH_IS_NOT_NULL(505,"新密码不能为空"),
    USERNAME_IS_NOT_NULL(506,"用户名不能为空"),
    USERNAME_NOT_EXIST(507,"用户名不存在"),
    PASSWORD_ERROR(508,"用户密码错误"),
    PASSWORD_IS_NOT_NULL(509,"密码不能为空"),
    LOGOUT_ERROR(510,"退出失败"),


    //订单的状态码
    //订单的get请求参数为空统一共用593状态码
//    ORDERID_IS_NULL(511,"orderId为空"),
    ORDERID_ERROR(512,"oderId不存在"),
//    ORDERLIST_PAGECURRENT_IS_NULL(513,"页码为空"),
    ORDERLIST_PAGECURRENT_NOT_EXIST(514,"页码不存在"),
//    ORDERLIST_PAGESIZE_IS_NULL(515,"pageSize为空"),
//    ORDERLIST_PAGESIZE_IS_ZERO(516,"pageSize为0"),


    FILE_ONLY_IMAGE(531, "仅支持添加图片"),
//    FILE_IMAGE_EMPTY(532, "图片为空"),
//    FILE_IMAGE_LIMIT_SIZE(533, "图片大小不超过5MB"),
    FILE_IMAGE_LIMIT_TYPE(534, "只接受 JPEG, PNG 和 GIF 格式的图片文件"),
    CATEGORY_ID_INVALID(544,"分类id无效"),

    CATEGORY_NAME_NOT_EMPTY(545,"分类名称不为空"),
    CATEGORY_NAME_LIMIT(546,"分类名称只能包含中文、数字、英文、空格、下划线和引号，且长度不超过六个字符"),
    CATEGORY_ID_ISNULL_ADD(547,"添加分类时，分类ID必须为空"),
    CATEGORY_DEFAULT_IMAGE(548,"请传入默认图片"),
    CATEGORY_STATE_INVALID(549,"分类显示状态无效"),
    CATEGORY_NAME_EXIST(550,"分类名称已存在"),
    CATEGORY_ORDINALNUMBER_INVALID(551,"分类排序序号无效"),
    CATEGORY_IMAGE_INVALID(552,"分类图片url无效"),


    // wu 的状态码
    PRODUCT_NOT_EXIST(561, "商品不存在，无法进行相关操作！"),
    FAILED_TO_UPDATE_STATUS(562, "上下架状态更新失败"),
    DELETE_PRODUCT_FAIL(563, "商品删除失败"),
    PARAMETER_VALUE_INVALID(571, "参数值非法！"),  // 例 price = -1
    STATUS_IS_INVALID(572,"状态值status非法"),
    PAGE_ID_INVALID(573, "pageId非法！"), // pageId = 1, pageId="abc"
    PARAMETER_VALUE_EMPTY(574, "XXX为空"),   // 必须参数 为空
    PRODUCT_EXIST(575, "商品已存在"),
    REQUEST_PARAMETER_TYPE_INCORRECT(591 ,"XXX请求参数类型错误");



    private final Integer code;

    private final String message;

    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
